Fractal Landscapes 2.0 (by Dennis Chao 2/91) 1. Introduction This program generates landscapes by a well-known algorithm that recursively "bends" a flat sheet. Imagine a large flat sheet. The first application of the algorithm will randomly "bend" the corners of the sheet up or down. The sharpness of the bends is limited by the arbitrary value "c". The second application will divide the sheet into four equal squares and bend their corners by a random value between 0 and c/2. The third run will divide each of the small squares into four smaller squares and bend their corners by a random value between 0 and c/4. This algorithm is repeated seven times. The seventh repetition bends the corners of 4096 squares. The bend of each of these squares does not exceed c/64. The overall effect of this process is surprisingly realistic. Its success can be attributed to the fact that nature, like the bent sheet, is fractal. 2. Fractals, an overview The following section is partly based on Benoit Mandelbrot's "The Fractal Geometry of Nature"... Mandelbrot coined the word "fractal" to describe a family of shapes impossible to describe with Euclidean geometry. These shapes have fractional dimensions that are greater than their topological (standard) dimensions. Now how can a shape have a fractional dimension? Suppose you have an infinitely long string with zero thickness. Now imagine bending that string an infinite number of times to fill a square. This square can't really be called two-dimensional because it is composed of a one-dimensional string. It is a sort of "plane-filling curve" because although the string has no breadth, there is an infinite amount of it packed infinitely close. It can be said to have a fractional geometry between one and two. An analogy to this may be simpler to understand. A thin piece of gauze seems two-dimensional. It is composed of densely- packed "one-dimensional" threads. The threads are made of molecules, which behave as zero-dimensional points. Oh well. I didn't say MUCH easier. The bent sheet that the program displays is a fractal because it has an infinite surface area. A large mountain may seem to have a finite surface area, but closer inspection reveals crags and cracks that will add to the surface area. Fractals geometry rears its recursive head when we discover that the crags and bumps consist of smaller crags and bumps ad infinitum... It may seem counterintuitive to say that a mountain has infinite surface area, but anything with this kind of infinite detail must have. However, the breaking down of a mountain only works to a certain point; after many divisions and magnifications, the mountain will not consist of crags and bumps, but of molecules. Of course these molecules may have a fractal nature, since they are made of atoms, which are made of subatomic particles, which may be made of quarks... 3. Using the program The program divides the screen into four areas. The main section displays the landscape from a three-dimensional viewpoint. The upper right corner gives an overhead view. Below this is a dial that displays the angle of the vantage point of the 3-d view. The lower right section is a text window that displays messages. The program uses the ten function keys and the space bar. The functions are listed below: F1 - ChDir - Using the ChDir option allows you to choose the directory in which you would like to save and load landscape files. F2 - Save - This will save a picture on the disk. The computer will ask for a file name. Do not add an extension. The program will automatically add ".FLD" on the end of your response. F3 - Load - F3 will load a previously saved landscape. Again, do not add an extension to the file name. F4 - Palette - F4 will invoke the palette command. You will be able to change the coloring scheme of the landscape. The options are: normal (like a natural landscape), false (brightly-colored), red (everything will be a shade of red), and blue (everything will be blue). [Default=normal] F5 - Angle - This allows you to change the angle of the vantage point of the next drawing that is displayed. The computer will display the current angle and will allow you to set NA, the angle for the next display. The dial displays the current angle, and the "next angle" will appear as a lighter line on the dial. The line on the dial will point in the direction you will face in the next drawing relative to the map. Angles should be entered in degrees. [Range=0..359, Default=0] F6 - Height - This option will change the height of your vantage point. A vantage point of 90 gives you a bird's eye view, and 0 gives a "snail's eye" view. [Range=0..90, Default=50] F7 - Cycle - Cycles the colors. Easier to see than to explain - try it! F8 - +Water - Pressing F8 will give you the option to toggle the display of water. When the water option is on, the program will display anything below a certain depth as a flat sheet, as if it were covered with water. [Default=Off] F9 - CragMax - F9 allows you to change the cragginess of the next picture generated. This option changes the amount the flat sheet is "bent". A value of 12 will give a very flat landscape, and 200 will give a very jagged landscape. [Range=12..200, Default=64] F0 - New - Hitting this key will cause the computer to generate a new landscape with any new settings for Angle, Height, Water, and CMax. The process takes seven steps. space bar - RDraw - Hitting the space bar makes the computer redraw the screen with the current landscape, but with updated Angle, Height, and Water options. Ctrl-Q - Quit - Quit ends the program. On VGA systems, the program also allows users to change the primary color content of the image by hitting [Ctrl] or [Alt] and "R", "G", or "B" to lower or raise the red, green, or blue intensity. 4. About the program Fracland was written in Turbo Pascal 6.0. It supports EGA and VGA systems. I'll send the source code for this program and for some other miscellaneous fractal-type stuff for $10. (Hey, I'm a poor college student! Haggle with me if you must.) Send any comments or suggestions to: Dennis Chao 457 Oaklawn Drive Pittsburgh, PA 15241 or to my E-mail address: dlchao@pucc.princeton.edu ----------------end-of-author's-documentation--------------- Software Library Information: This disk copy provided as a service of Public (software) Library We are not the authors of this program, nor are we associated with the author in any way other than as a distributor of the program in accordance with the author's terms of distribution. Please direct shareware payments and specific questions about this program to the author of the program, whose name appears elsewhere in this documentation. If you have trouble getting in touch with the author, we will do whatever we can to help you with your questions. All programs have been tested and do run. To report problems, please use the form that is in the file PROBLEM.DOC on many of our disks or in other written for- mat with screen printouts, if possible. PsL cannot debug pro- programs over the telephone, though we can answer questions. Disks in the PsL are updated monthly, so if you did not get this disk directly from the PsL, you should be aware that the files in this set may no longer be the current versions. Also, if you got this disk from another vendor and are having prob- lems, be aware that some files may have become corrupted or lost by that vendor. Get a current, working disk from PsL. For a copy of the latest monthly software library newsletter and a list of the 3,000+ disks in the library, call or write Public (software) Library P.O.Box 35705 - F Houston, TX 77235-5705 1-800-2424-PSL MC/Visa/AmEx/Discover Outside of U.S. or in Texas or for general information, Call 1-713-524-6394 PsL also has an outstanding catalog for the Macintosh.